"""add section type for specification

Revision ID: 2b53a09b6b1e
Revises: 808d3b77a37a
Create Date: 2024-02-15 00:29:19.561930

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

# revision identifiers, used by Alembic.
revision: str = "2b53a09b6b1e"
down_revision: Union[str, None] = "808d3b77a37a"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column("incoming_so",
                  sa.Column("section_type", sa.String(), nullable=True))
    op.alter_column(
        "incoming_so",
        "section_name",
        existing_type=sa.VARCHAR(),
        nullable=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column(
        "incoming_so",
        "section_name",
        existing_type=sa.VARCHAR(),
        nullable=True,
    )
    op.drop_column("incoming_so", "section_type")
    # ### end Alembic commands ###
